#include <stdio.h>
#include <stdlib.h>

int main()
{
	FILE* stream;
	stream = fopen("data.txt", "wb+");

	printf("writing..\n");
	char* data = "writing data";
	fwrite(data, 13, 1, stream);
//	fflush(stream);
	fseek(stream, 0L, SEEK_SET);

	printf("to read..\n");
	char str[20] = {0};
	size_t read_size = fread(str, 10, 1, stream);
	if(read_size > 0)
	{
		printf("%s\n", str);
	}
}
